package com.woniuxy.threadmethods;

import lombok.extern.slf4j.Slf4j;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO:
 * <P> Date: 2022/4/6:19:03
 * <P> Description:
 */
@Slf4j(topic = "c.Test7")
public class Test7 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread("t1") {
            @Override
            public void run() {
                log.debug("sleep");
                try {
                    Thread.sleep(20000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                    log.debug("wake up");
                }
            }
        };
        t1.start();
        Thread.sleep(1000);
        log.debug("interrupt..");
        t1.interrupt();
    }
}
